package com.enjoy.mall.sentinel.service.impl;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.enjoy.mall.sentinel.entity.UserEntity;
import com.enjoy.mall.sentinel.service.UserService;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService {
    @Override
    public UserEntity getById(Integer id) {

        return new UserEntity();
    }
    public UserEntity handleException(Integer id, BlockException ex) {
        UserEntity userEntity = new UserEntity();
        userEntity.setUsername("===被限流降级啦===");
        return userEntity;
    }
}
